<?php
$this->title = "A-PMS项目管理系统-我的提示信息";


$this->registerCssFile('/css/index.css');
$this->registerCssFile('/css/paging.css');
$this->registerCssFile('/css/OfficeHall.css');



$this->registerJsFile('/js/common.js');
$this->registerJsFile('/js/index.js');
$this->registerJsFile('/js/paging.js');
$this->registerJsFile('/js/OfficeHall.js');


$this->registerCss('  
    .wrap{margin: 0 auto 0;}   
    .navbar-default{border : none;}
    .myfooter p{line-height : 100px;}
');


?>

<style type="text/css">
    .remand-nav span.pull-right{color: #2194f1; cursor: pointer; font-size: 15px;}
</style>



<div class="OfficeHallContentAll container1200 clearfix remand" style="box-shadow: 0px 1px 6px 0px rgba(91, 91, 91, 0.18);">
    <div class="remand-nav clearfix">
        <img src="/image/officeHall/uploadAssetPackage/wsxx.png" class="pull-left">
        <span class="pull-left">我的提醒</span>
        <span class="pull-right" id="readAll">标记所有为已读</span>
    </div>
    <?php
    if (!empty($daiShenPinTiXingData) && $daiShenPinTiXingData['data']['count']>0) {
        $daiShenPinTiXingCount = $daiShenPinTiXingData['data']['count'];
    }else{
        $daiShenPinTiXingCount = 0;
    }
    if (!empty($shenPinFanKuiData) && $shenPinFanKuiData['data']['count']>0) {
        $shenPinFanKuiCount = $shenPinFanKuiData['data']['count'];
    }else{
        $shenPinFanKuiCount = 0;
    }
    if (!empty($getMessagePackageData) && $getMessagePackageData['data']['count']>0) {
        $getMessagePackageCount = $getMessagePackageData['data']['count'];
    }else{
        $getMessagePackageCount = 0;
    }
    if (!empty($getMessageProjectData) && $getMessageProjectData['data']['count']>0) {
        $getMessageProjectCount = $getMessageProjectData['data']['count'];
    }else{
        $getMessageProjectCount = 0;
    }
    ?>
    <!-- 全部选项 -->
    <div class="remand-navtabs clearfix" id="Pall">
        <span class="active pull-left tabs-all">全部(<?= $daiShenPinTiXingCount+$shenPinFanKuiCount+$getMessageProjectCount+$getMessagePackageCount ?>)</span>
        <span class="pull-left tabs-dsptx">待审批提醒(<?= $daiShenPinTiXingCount ?>)</span>
        <span class="pull-left tabs-spfk">审批反馈(<?= $shenPinFanKuiCount ?>)</span>
        <span class="pull-left tabs-gzgx">关注更新(<?= $getMessageProjectCount+$getMessagePackageCount ?>)</span>
    </div>
    <div class="remand-lists">
        <!-- 列表1 -->
            <?= $this->render('list1',['daiShenPinTiXingData'=>$daiShenPinTiXingData])?>
        <!-- 列表3 -->
            <?= $this->render('list3',['shenPinFanKuiData'=>$shenPinFanKuiData])?>
        <!-- 列表4 -->
        <div class="remand-list gzgx">
            <?= $this->render('list4',['getMessagePackageData'=>$getMessagePackageData, 'getMessageProjectData'=>$getMessageProjectData])?>
        </div>
    </div>
</div>

<script>
    $(function () {
        $("#readAll").click(function () {
            var groupInmage = 0;
            var message_group = [];
            $("#Pall span").each(function(v,i){
               if ($(this).attr('class').indexOf('active')>0){
                   groupInmage = v;
               }
            });
            switch(groupInmage){
                case 0:
                    message_group = [11,12,21,22,3];
                    break;
                case 1:
                    message_group = [11,12];
                    break;
                case 2:
                    message_group = [21,22];
                    break;
                case 3:
                    message_group = [3];
                    break;
                default:
                    message_group = [11,12,21,22,3];
                    break;
            }
            $.post('/instation-message/update-all',{message_group:message_group},function (res) {
                resArr =JSON.parse(res);
                if (resArr.code == 200){
                    layer.msg("全部已读")
                    window.location.reload();
                }else{
                    layer.msg("xxx")
                }
            })
        })
    })
</script>